﻿<html xmlns="http://www.w3.org/1999/xhtml">
<head >
    <title>驰骋权限管理系统</title>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link href="../WF/Style/skin/css/login.css" rel="stylesheet" type="text/css" />
    <link href="../WF/Scripts/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
</head>
<body class="login-bg">
<div class="login-box">
           <h1 class="logo-name">驰骋权限管理系统-登录</h1>
           <div class="login-form">
             <form id="Form1" >
                <div class="form-group">
                    <input type="text" id="TB_No" name="TB_No" placeholder="请输入账号" lay-verify="required"  class="form-control" />
                </div>
                <div class="form-group">
                    <input type="password" id="TB_PW" name="TB_PW" placeholder="请输入密码" lay-verify="required"  class="form-control"  />
                </div>
                <input type="button" class="btn btn-primary btn-block" value="操作员登录" lay-submit lay-filter="formDemo" />

            </form>
            <div class="row login-nav">
            	<div class="col-xs-6">默认密码：123</div>
            	<div class="col-xs-6 ">
                <a href="../WF/Admin/CCBPMDesigner/Login.htm"  class="pull-right">流程设计器</a>
                <a href="../WF/AppClassic/Login.htm"  class="pull-right">流程前台登录</a>
                <a href="http://ccbpm.mydoc.io" target=_blank class="pull-right">帮助文档&nbsp;&nbsp;</a>
                </div>
            </div>
              
        </div>
   </div>
  
   <script src="../WF/Style/skin/layui/layui.js" type="text/javascript"></script>
   
    <script src="../WF/Scripts/jquery/jquery.min.js" type="text/javascript"></script>
    <!-- 引用通用的js文件. -->
    <script type="text/javascript" src="../WF/Scripts/config.js"></script>
    <script type="text/javascript" src="../WF/Comm/Gener.js"></script>
    <script type="text/javascript" language="javascript" >        
    //页面启动函数.

        layui.use(['form', 'layer'], function () {

            //从后台获取当前登录会话的信息.
            var handler = new HttpHandler("BP.WF.HttpHandler.WF_AppClassic");
            var data = handler.DoMethodReturnString("Login_Init");
            if (data.indexOf('err@') == 0) {
                alert(data);
                return;
            }
            data = JSON.parse(data);

            //调用公共类库的方法:执行批量主表赋值
            GenerFullAllCtrlsVal(data);
            var userNo = document.getElementById("TB_No").value;
            if (userNo == "")
                document.getElementById("TB_PW").value = "";

            var form = layui.form, layer = layui.layer, $ = layui.jquery;
            form.on('submit(formDemo)', function (data) {

                var userNo = $("#TB_No").val();
                var userPass = $("#TB_PW").val();

                if (userNo == "" || userPass == "") {
                    layer.msg('请输入用户名与密码');
                    return false;
                }

                var handler = new HttpHandler("BP.WF.HttpHandler.WF_AppClassic");

                handler.AddPara("TB_No", encodeURIComponent(userNo));
                handler.AddPara("TB_PW", userPass);

                var data = handler.DoMethodReturnString("Login_Submit");

                if (data.indexOf('err@') == 0) {

                    layer.msg(data, { time: 3000, icon: 2 });

                } else {
                    layer.msg(data, { time: 10, icon: 1 }, function () {
                        location.href = 'Home.htm';
                    });
                }
            })
        });
        
        </script>
</body>
</html>
